/* eslint-disable prettier/prettier */
// src/schemas/article.schema.ts
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

@Schema({
  collection: 'knowledge', // 指定集合名称
  timestamps: {
    currentTime: () => Date.now(),
    createdAt: 'createTime',
    updatedAt: 'updateTime',
  },
})
export class Knowledge extends Document {
  @Prop()
  collectionNumber: string;

  @Prop()
  commentNumber: number;

  @Prop()
  content: string;

  @Prop([String])
  coverUrl: string[];

  @Prop()
  creatorAvatar: string;

  @Prop()
  creatorDep: string;

  @Prop() 
  creatorHospitalName: string;

  @Prop()
  creatorId: string;

  @Prop()
  creatorName: string;

  @Prop()
  creatorTitles: string;

  @Prop()
  hospitalGrade: string;

  @Prop()
  likeFlag: number;

  @Prop()
  title: string;

  @Prop()
  topics: string;
}

export const knowledgeSchema = SchemaFactory.createForClass(Knowledge);